Devices including or coupled to one or more digital cameras use a camera lens to focus incoming light onto a camera sensor for capturing digital images. The curvature of a camera lens places a range of depth of the scene in focus. Portions of the scene closer or further than the range of depth may be out of focus, and therefore appear blurry in a captured image. The distance of the camera lens from the camera sensor (the “focal length”) is directly related to the distance of the range of depth for the scene from the camera sensor that is in focus (the “focus distance”). Many devices are capable of adjusting the focal length, such as by moving the camera lens to adjust the distance between the camera lens and the camera sensor, and thereby adjusting the focus distance.
Many devices automatically determine the focal length. For example, a user may touch an area of a preview image provided by the device (such as a person or landmark in the previewed scene) to indicate the portion of the scene to be in focus. In response, the device may automatically perform an autofocus (AF) operation to adjust the focal length so that the portion of the scene is in focus. The device may then use the determined focal length for subsequent image captures (including generating a preview).
A demosaicing (also de-mosaicing, demosaicking, or debayering) algorithm is a digital image process used to reconstruct a color image from output from an image sensor overlaid with a CFA. The demosaic process may also be known as CFA interpolation or color reconstruction. Most modern digital cameras acquire images using a single image sensor overlaid with a CFA, so demosaicing may be part of the processing pipeline required to render these images into a viewable format. To capture color images, photo sensitive elements (or sensor elements) of the image sensor may be arranged in an array and detect wavelengths of light associated with different colors. For example, a sensor element may be configured to detect a first, a second, and a third color (e.g., red, green and blue ranges of wavelengths). To accomplish this, each sensor element may be covered with a single color filter (e.g., a red, green or blue filter). Individual color filters may be arranged into a pattern to form a CFA over an array of sensor elements such that each individual filter in the CFA is aligned with one individual sensor element in the array. Accordingly, each sensor element in the array may detect the single color of light corresponding to the filter aligned with it.
The Bayer pattern has typically been viewed as the industry standard, where the array portion consists of rows of alternating red and green color filters and alternating blue and green color filters. Usually, each color filter corresponds to one sensor element in an underlying sensor element array.